﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsDCRectDouble : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsDCRectDouble(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsDCRectDouble obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsDCRectDouble()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsDCRectDouble(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGsDCRectDouble() : this(GlobalsPINVOKE.new_OdGsDCRectDouble__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsDCRectDouble(OdGePoint2d minPoint, OdGePoint2d maxPoint) : this(GlobalsPINVOKE.new_OdGsDCRectDouble__SWIG_1(OdGePoint2d.getCPtr(minPoint), OdGePoint2d.getCPtr(maxPoint)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsDCRectDouble(double xMin, double xMax, double yMin, double yMax) : this(GlobalsPINVOKE.new_OdGsDCRectDouble__SWIG_2(xMin, xMax, yMin, yMax), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsDCRectDouble(OdGsDCRect rc) : this(GlobalsPINVOKE.new_OdGsDCRectDouble__SWIG_3(OdGsDCRect.getCPtr(rc)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsDCRectDouble Assign(OdGsDCRect dcRect)
		{
			OdGsDCRectDouble result = new OdGsDCRectDouble(GlobalsPINVOKE.OdGsDCRectDouble_Assign(this.swigCPtr, OdGsDCRect.getCPtr(dcRect)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGsDCRectDouble dcRect)
		{
			bool result = GlobalsPINVOKE.OdGsDCRectDouble_IsEqual(this.swigCPtr, OdGsDCRectDouble.getCPtr(dcRect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdGsDCRectDouble dcRect)
		{
			bool result = GlobalsPINVOKE.OdGsDCRectDouble_IsNotEqual(this.swigCPtr, OdGsDCRectDouble.getCPtr(dcRect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGsDCRect round()
		{
			OdGsDCRect result = new OdGsDCRect(GlobalsPINVOKE.OdGsDCRectDouble_round(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d m_min
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsDCRectDouble_m_min_get(this.swigCPtr);
				OdGePoint2d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint2d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsDCRectDouble_m_min_set(this.swigCPtr, OdGePoint2d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint2d m_max
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsDCRectDouble_m_max_get(this.swigCPtr);
				OdGePoint2d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint2d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsDCRectDouble_m_max_set(this.swigCPtr, OdGePoint2d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
